import { ajax } from '../util/';

/**
 * 导出所有模块需要用到接口
 * 一级属性：模块名
 * 一级属性中的方法：当前模块需要用的接口
 * @type {Object}
 */
module.exports = {
    user: {
        /**
         * 登录
         * @param {object} data                 参数
         * @param {string} data.username        登陆用户名
         * @param {string} data.password        登陆密码
         * @param {function} fn                 成功回调
         */
        login(data, fn, errFn) {
            ajax.call(this, 'post', '/manage_admin/login', data, fn, true, errFn);
        }
    },

    account:{
        userList(data, fn, errFn) {
            ajax.call(this, 'post', '/manage_user/userList', data, fn, true, errFn);
        },

        userDetail(data, fn, errFn) {
            ajax.call(this, 'post', '/manage_user/userDetail', data, fn, true, errFn);
        }
        
    },

    personal: {
        personalList(data,fn,errFn) {
             ajax.call(this, 'post', '/manage_prove/personalList', data, fn, true, errFn);
        }
    }
};